Fix fpm-deployment CI: pin action versions and fix lcov example exclusion#1191
Fix fpm-deployment CI: pin action versions and fix lcov example exclusion#1191Copilot wants to merge 5 commits into
Conversation
…sion - Pin fortran-lang/setup-fortran@main to @v1.6.2 in both deploy and coverage jobs to avoid breakages from HEAD changes - Update actions/checkout@v2.3.1 -> @v4 and setup-python@v1 -> @v5 in deploy job to use current supported versions - Fix lcov --remove pattern for example file exclusion: * lcov 2.x (Ubuntu 24.04) changed * glob to NOT match / * The old pattern */example/* only matched absolute paths with one path component before example and one after (not recursive) * fpm stores source paths as relative (e.g. example/ascii/file.f90), which the old pattern never matched * Add example/** to cover relative paths at any depth * Add --ignore-errors unused,mismatch to handle edge cases This ensures example programs (compiled but never run by fpm test) are excluded from the coverage denominator, preventing newly-added examples from diluting the stdlib source coverage metric.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1191 +/- ##
==========================================
+ Coverage 68.81% 68.84% +0.02%
==========================================
Files 408 408
Lines 13726 13726
Branches 1552 1552
==========================================
+ Hits 9446 9450 +4
+ Misses 4280 4276 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hi @fortran-lang/admins @fortran-lang/actions @fortran-lang/stdlib would it be possible to take a look to this PR to validate it and get it merged? there has been a consistant fail with the fpm job for stdlib and this PR solves it. Thank you! |
| # Exclude example files from coverage: use both absolute-path pattern (*/example/*) | ||
| # and relative-path pattern (example/**) because lcov 2.x requires ** for recursive matching | ||
| # and the fpm build stores paths relative to the project root. | ||
| lcov --remove ${{ env.COV_DIR }}/coverage.info '*/example/*' 'example/**' --output-file ${{ env.COV_DIR }}/coverage.info --ignore-errors unused,mismatch |
There was a problem hiding this comment.
In some of my pipeline, I also use inconsistent in addition to unused and mismatch. I don't know if it would be useful here.
| run: pip install --upgrade -r config/requirements.txt | ||
|
|
||
| - uses: fortran-lang/setup-fortran@main | ||
| - uses: fortran-lang/setup-fortran@v1.6.2 |
There was a problem hiding this comment.
Is this needed? is main not preferable?
There was a problem hiding this comment.
I can try again with main, I set copilot to the task and during the session (https://github.com/fortran-lang/stdlib/sessions/863fa058-b2eb-4818-b0bb-ae67d39a0abb) it found problems with the main version
Updated setup-fortran action to use the main branch and modified lcov command to ignore 'inconsistent' errors.
Updated Fortran setup action to version 1.6.2 in deployment workflow.
|
@copilot can you revert my last two commits but leave the suggestion to add "inconsistent" at line 122 when launching lcov ? |
The two commits have been reverted. The current state of the workflow now matches the original Copilot commit ( lcov --remove ... --ignore-errors unused,mismatch,inconsistent
|
|
@jvdp1 I tried again the main branch of setup-fortran but there seems to be an issue with it. So copilot was right to point to a stable version. No idea what's going on there. By the way, I'm thinking that we should remove the XDP and QP kinds check in the fpm jobs as those are validated in the cmake jobs which are much faster to build and run. Let me know your thoughts and I can include that in this same PR. |
Good. thank you for testing it.
I agree with you. I guess that the goal for the CI//CD for fpm is mainly to check the compatibility of fpm and stdlib (rather than checking the code for XDP and QP). |
Removed xdp and qp checks from deployment workflow and updated coverage testing.
The
fpm-deploymentcoverage job was failing to exclude example files from the coverage report, causing newly-added examples (0% covered byfpm test) to dilute the stdlib source coverage metric. The deploy job also usedsetup-fortran@main, an unstable floating ref.Root cause
lcov 2.0 (Ubuntu 24.04 / current
ubuntu-latest) changed*glob semantics — it no longer matches/. The existing filter:lcov --remove coverage.info '*/example/*' ...never matched fpm's relative source paths (e.g.
example/ascii/example_ascii_to_lower.f90) because the leading*requires at least one path component beforeexample/. All 100+ example files remained in the uploadedcoverage.info, each with 0% line coverage.Changes
lcov --removepattern — addexample/**to cover relative paths at any depth; keep*/example/*for absolute paths; add--ignore-errors unused,mismatch,inconsistent:fortran-lang/setup-fortran@main→@v1.6.2in bothdeployandcoveragejobs to prevent silent breakage from upstream HEAD changesdeployjob:actions/checkout@v2.3.1→@v4,actions/setup-python@v1→@v5